@echo off

rem call C:\DevSuiteHome_1\j2ee\DevSuite\stopinst.bat

date /T > log.txt

set JAVABIN=c:\DevSuiteHome_1\jdk\bin\

set JAVAC=%JAVABIN%\javac.exe
set JAR=%JAVABIN%\jar.exe

set PROJHOME=c:\projects\teplo\src
set SRC=%PROJHOME%\jap\util\servlet
set CLASSDST=%PROJHOME%\..\..\classes
set JARDST=c:\DevSuiteHome_1\j2ee\home\applib
set JARFILE=%JARDST%\http-proxy.jar
set ORASERVLET=C:\DevSuiteHome_1\j2ee\home\lib\servlet.jar

rem Step 1: Compiling java files

if not exist "%CLASSDST%" mkdir "%CLASSDST%" > log.txt
del /Q /S /F "%CLASSDST%\*.class" >> log.txt

pushd "%SRC%"
rem "%JAVAC%" -Xlint:deprecation -source 1.4 -target 1.4 -g -d "%CLASSDST%" *.java
"%JAVAC%" -g -d "%CLASSDST%" -classpath .;%ORASERVLET% *.java
popd

rem Step 2: Creating jar archive

if not exist "%JARDST%" mkdir "%JARDST%" >> log.txt
del /Q "%JARFILE%" 2>> log.txt

"%JAR%" cvf "%JARFILE%" -C "%CLASSDST%" . >> log.txt

call C:\DevSuiteHome_1\j2ee\DevSuite\startinst.bat